package com.company.project.controller;


import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.company.project.common.utils.RestUtil;
import com.company.project.pojo.Rest;
import com.company.project.pojo.ServiceCode;
import com.company.project.pojo.configFile.ConfigFile;
import com.company.project.pojo.configFile.ConfigFileVO;
import com.company.project.service.IConfigFileService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author 任建波
 * @since 2019-11-14
 */

@Api(value = "文件地址配置",tags = "文件地址配置")
@Controller
@RequestMapping("config-file")
public class ConfigFileController {

    @Autowired
    IConfigFileService iConfigFileService;

    @ApiOperation(value = "获取文件地址配置")
    @RequestMapping(value = "getConfigFile", method = RequestMethod.GET)
    @ResponseBody
    public Rest<ConfigFileVO> getConfigFile(){
        ConfigFile configFile = iConfigFileService.getById(1);
        ConfigFileVO configFileVO = new ConfigFileVO();
        BeanUtils.copyProperties(configFile, configFileVO);
        return RestUtil.rest(ServiceCode.CODE_200, "成功" , configFileVO);
    }

}

